﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Collections;
using System.Configuration;
using System.Net;
using System.Net.NetworkInformation;

namespace WaveMaster.Holidays.Club.ServiceServer
{
    public partial class PrinterMonitoringServerForm : Form
    {
        bool m_close = false;

        public PrinterMonitoringServerForm()
        {
            InitializeComponent();
            string configName = System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
            System.Runtime.Remoting.RemotingConfiguration.Configure(configName);
        }

        private void PrinterMonitoringForm_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = !m_close;
            HideTonotify();
        }

        private void HideTonotify()
        {
            this.Hide();
            notifyIcon1.BalloonTipText = "WaveMaster Print Request Server is running";
            notifyIcon1.ShowBalloonTip(100);
            notifyIcon1.Text = notifyIcon1.BalloonTipText;
        }

        private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            this.Show();
        }

        private void buttonExit_Click(object sender, EventArgs e)
        {
            m_close = true;
            this.Close();
        }

        private void PrinterMonitoringForm_Shown(object sender, EventArgs e)
        {
            HideTonotify();
        }
    }
}
